package cn.javabb.common.exception;

import cn.javabb.common.enums.ResponseEnum;

/**
 * 权限异常
 */
public class ForbiddenException extends BaseException {

    private static final long serialVersionUID = 1L;

    public ForbiddenException() {
        super();
    }

    public ForbiddenException(String message) {
        super(message);
    }

    public ForbiddenException(Integer code, String message) {
        super(code, message);
    }

    @Override
    public Integer getCode() {
        Integer code = super.getCode();
        if (code == null) {
            code = ResponseEnum.FORBIDDEN.getCode();
        }
        return code;
    }

    @Override
    public String getMessage() {
        String message = super.getMessage();
        if (message == null) {
            message = ResponseEnum.FORBIDDEN.getMessage();
        }
        return message;
    }
}
